﻿//-----------------------------------------------------------------------
// <copyright file="IProductionSystem.cs" company="tuliprules.org">
//     Copyright (c) 2010 tuplelister, tuliprules.org.
// </copyright>
// <summary>This is the IProductionSystem interface.</summary>
//-----------------------------------------------------------------------

namespace Tulip.Rules
{
    /// <summary>
    /// Represents a production system.
    /// </summary>
    /// <remarks>
    /// A production system is a type of rule engine that evaluates production rules.  A production 
    /// rule has the form &lt;conditions&gt; -&gt; &lt;actions&gt;.  Each rule is a 're-write' rule 
    /// whose action list can contain instructions that modify the factTypes asserted to the engine, 
    /// retract factTypes or assert new factTypes.  Each time the set of asserted factTypes is changed, the 
    /// engine enters a recursive cycle in which it re-evaluates rules against the changed data and 
    /// recomputes the set of matches (the 'conflict set').  After each recomputation, the engine 
    /// starts to 'fire' rules in some given order of the matches.
    /// </remarks>
    public interface IProductionSystem
    {
        /// <summary>
        /// Gets the current working memory of the production system.
        /// </summary>
        /// <remarks>The working memory stores asserted tuples and provides functionality for asserting, retracting and modifying tuples.</remarks>
        /// <value>The current working memory of the production system.</value>
        IWorkingMemory WorkingMemory
        {
            get;
        }

        /// <summary>
        /// Gets the agenda currently being used by the rule engine.
        /// </summary>
        /// <remarks>The agenda represents the current resolved conflict set and can be used to inspect or clear activations.</remarks>
        /// <value>The agenda currently being used by the rule engine.</value>
        IAgenda Agenda
        {
            get;
        }
    }
}
